<template>
  <div @scroll="PageSwipe" style="overflow: auto;height: 100vh;" :class='ZhuTi? "white":"black"'>
    <router-view></router-view>
  </div>
</template>

<script>


import {mapMutations, mapActions, mapState} from 'vuex'


export default {
  name: 'App',
  data() {
    return {}
  },
  methods: {
    ...mapMutations(['setHeight']),
    ...mapActions(['getWebsiteInfo']),
    // 页面滑动
    PageSwipe(e) {
      let height = e.target.scrollTop;
      this.setHeight(height)
    },
  },
  mounted() {
    // 保存cookie中的用户信息
    let userinfo = this.$cookies.get('userinfo')
    this.$store.commit('setUserInfo', userinfo)
    // 获取网站相关信息
    this.getWebsiteInfo()
  },
  computed: {
    ...mapState(['ZhuTi'])
  }
}
</script>

<style lang="less">
/*重置页面的部分样式*/
body {
  margin: 0;
  background-color: #f0eeee;
}

a:link {
  Text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

input {
  padding: 0;
  outline: none;
}

.black {
  .isshow[data-v-38923b5f] {
    background-color: #222429;
  }
}

</style>
